﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL_HealthInsurance;
using DTO_HealthInsurance;



namespace HealthInsuranceMgm.Admin
{
    
    public partial class AddSurrence : System.Web.UI.Page
    {
        DTOCompanyDetail objdtoCom = new DTOCompanyDetail();
        BLLCompany objbllCom = new BLLCompany();
       
        protected void Page_Load(object sender, EventArgs e)
        {
          

        }
        public void message(string script)
        {
         
            Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", script, true);
        }
       
       
        protected void btnAdd_Click(object sender, EventArgs e)
        {
           if(IsValid){
               string companyname = txtCompanyName.Text;
               string address = txtAddress.Text;
               string phone = txtphone.Text;
               string url = txturl.Text;

               objdtoCom.CompanyName = companyname;
               objdtoCom.Address = address;
               objdtoCom.Phone = txtphone.Text;
               objdtoCom.CompanyUrl = url;

               int i = objbllCom.insertCompany(objdtoCom);

               if (i > 0)
               {

                   message("alert('Insert Succesfull');");

               }
           }
        }
    }
}